/// @tags:
#include <cstdio>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

using ll = long long;

constexpr int maxn = 100, mod = 998244353;

struct Node {
  int l, r;
  int id;
} itv[maxn + 1];

ll qpow(ll base, int exp) {
  ll res = 1;
  while (exp) {
    if (exp & 1) res = res * base % mod;
    base = base * base % mod;
    exp >>= 1;
  }
  return res;
}

ll frac[maxn * 2 + 2], invf[maxn * 2 + 2];

ll binom(int n, int m) { return frac[n] * invf[m] % mod * invf[n - m] % mod; }

int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= k; ++i) {
      cin >> itv[i].l >> itv[i].r;
    }
    frac[0] = 1;
    for (int i = 1; i <= n * 2; ++i) {
      frac[i] = frac[i - 1] * i % mod;
    }
    invf[n * 2] = qpow(frac[n * 2], mod - 2);
    for (int i = n * 2 - 1; i >= 0; --i) {
      invf[i] = invf[i + 1] * (i + 1) % mod;
    }
    std::sort(itv + 1, itv + k + 1, [](const Node& lhs, const Node& rhs) {
      return (lhs.l != rhs.l ? lhs.l < rhs.l : lhs.r > rhs.r);
    });

    for (int i = 1; i <= n; ++i) {
      
    }
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("E. Hyperregular Bracket Strings.in", "r", stdin);
  freopen("E. Hyperregular Bracket Strings.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
